package com.deyuanyun.pic.pbf.controller.dto.defect.repair;

import com.deyuanyun.pic.common.spring.SpringAppliction;
import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.common.util.format.NumberFormat;
import com.deyuanyun.pic.pbf.domain.RepairReplacePipe;
import com.deyuanyun.pic.settings.support.biz.CodeUtil;

/**
 * 4,换管表
 *
 * @author huanglw
 * @date 2016-6-23
 *
 * History: [修改人][时间][修改描述]
 */
public class RepairReplacePipeDto extends RepairDto {

    /**
     * 起始位置x
     */
    private String startX;

    /**
     * 起始位置y
     */
    private String startY;

    /**
     * 起始位置z
     */
    private String startZ;

    /**
     * 起始绝对距离（m）
     */
    private String startMileage;

    /**
     * 终点位置x
     */
    private String endX;

    /**
     * 终点位置y
     */
    private String endY;

    /**
     * 终点位置z
     */
    private String endZ;

    /**
     * 终点绝对距离（m）
     */
    private String endMileage;

    /**
     * 换管材质
     */
    private String material;

    /**
     * 制管方式
     */
    private String manuPipeType;

    /**
     * 管径（mm）
     */
    private String diameter;

    /**
     * 壁厚（mm）
     */
    private String wallThickness;

    /**
     * 换管长度（m）
     */
    private String length;

    /**
     * 防腐材料
     */
    private String coatingMaterial;

    /**
     * 防腐等级
     */
    private String coatingGrade;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    public RepairReplacePipeDto(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public String getStartX() {
        return startX;
    }

    public void setStartX(String startX) {
        this.startX = startX;
    }

    public String getStartY() {
        return startY;
    }

    public void setStartY(String startY) {
        this.startY = startY;
    }

    public String getStartZ() {
        return startZ;
    }

    public void setStartZ(String startZ) {
        this.startZ = startZ;
    }

    public String getStartMileage() {
        return startMileage;
    }

    public void setStartMileage(String startMileage) {
        this.startMileage = startMileage;
    }

    public String getEndX() {
        return endX;
    }

    public void setEndX(String endX) {
        this.endX = endX;
    }

    public String getEndY() {
        return endY;
    }

    public void setEndY(String endY) {
        this.endY = endY;
    }

    public String getEndZ() {
        return endZ;
    }

    public void setEndZ(String endZ) {
        this.endZ = endZ;
    }

    public String getEndMileage() {
        return endMileage;
    }

    public void setEndMileage(String endMileage) {
        this.endMileage = endMileage;
    }

    public String getMaterial() {
        return material;
    }

    public void setMaterial(String material) {
        this.material = material;
    }

    public String getManuPipeType() {
        return manuPipeType;
    }

    public void setManuPipeType(String manuPipeType) {
        this.manuPipeType = manuPipeType;
    }

    public String getDiameter() {
        return diameter;
    }

    public void setDiameter(String diameter) {
        this.diameter = diameter;
    }

    public String getWallThickness() {
        return wallThickness;
    }

    public void setWallThickness(String wallThickness) {
        this.wallThickness = wallThickness;
    }

    public String getLength() {
        return length;
    }

    public void setLength(String length) {
        this.length = length;
    }

    public String getCoatingMaterial() {
        return coatingMaterial;
    }

    public void setCoatingMaterial(String coatingMaterial) {
        this.coatingMaterial = coatingMaterial;
    }

    public String getCoatingGrade() {
        return coatingGrade;
    }

    public void setCoatingGrade(String coatingGrade) {
        this.coatingGrade = coatingGrade;
    }

    public void fromDomain(RepairReplacePipe domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        // 起始位置x
        this.startX = NumberFormat.format(domain.getStartX());
        // 起始位置y
        this.startY = NumberFormat.format(domain.getStartY());
        // 起始位置z
        this.startZ = NumberFormat.format(domain.getStartZ());
        // 起始绝对距离（m）
        this.startMileage = NumberFormat.format(domain.getStartMileage());
        // 起始位置x
        this.endX = NumberFormat.format(domain.getEndX());
        // 起始位置y
        this.endY = NumberFormat.format(domain.getEndY());
        // 起始位置z
        this.endZ = NumberFormat.format(domain.getEndZ());
        // 起始绝对距离（m）
        this.endMileage = NumberFormat.format(domain.getEndMileage());
        // 换管材质
        this.material = CodeUtil.getName(domain.getMaterial());
        // 制管方式
        this.manuPipeType = CodeUtil.getName(domain.getManuPipeType());
        // 管径（mm）
        this.diameter = CodeUtil.getName(domain.getDiameter());
        // 壁厚（mm）
        this.wallThickness = NumberFormat.format(domain.getWallThickness());
        // 换管长度（m）
        this.length = NumberFormat.format(domain.getLenth());
        // 防腐材料
        this.coatingMaterial = CodeUtil.getName(domain.getCoatingMaterial());
        // 防腐等级
        this.coatingGrade = CodeUtil.getName(domain.getCoatingGrade());

        // 赋值
        super.fromDomain(domain.getId(), domain.getCreateRemark());
    }
}

